package com.ark.cloud.java.persistence.service.impl;


import com.ark.cloud.java.persistence.entity.DetectEvent;
import com.ark.cloud.java.persistence.mapper.DetectEventMapper;
import com.ark.cloud.java.persistence.service.DetectEventService;
import com.ark.cloud.java.persistence.utils.UUIDUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * @author fukun
 * @create 2021/9/1  上午10:19
 * @description
 */
@Service
@Slf4j

public class DetectEventServiceImpl extends ServiceImpl<DetectEventMapper, DetectEvent> implements DetectEventService {

    @Autowired
    DetectEventMapper detectEventDao;

    @Async
    @Override
    public void saveDetectEventInfo(DetectEvent detectEvent) {


        //设置主键
        detectEvent.setDetectEventId(UUIDUtil.next());

        System.out.println("detectEvent:"+detectEvent);
        log.info("dectEvent: {}", detectEvent.toString());

        detectEventDao.saveDetectEventInfo(detectEvent);

//        detectEventDao.insert(detectEvent);
    }
}
